<template>
  <el-dialog width="60%" :visible.sync="visible" :title="'选择规则'" :close-on-click-modal="false" :close-on-press-escape="false">
    <!--  锁定表头设置   :height="this.tableHeight" -->
    <vxe-table ref="xTable" :loading="dataListLoading" class="vxe-table-element" auto-resize highlight-current-row
      :data="dataList" @cell-dblclick="({row})=>{handle(row)}">
      <vxe-table-column type="index" fixed="left" width="50" align="center"></vxe-table-column>
      <vxe-table-column field="eventCode" title="预警项编码">
      </vxe-table-column>
      <vxe-table-column field="title" title="规则定义描述">
      </vxe-table-column>

      <vxe-table-column title="handle" width="70" show-overflow="false" fixed="right" align="center">
        <template slot-scope="scope">
          <el-button type="text" size="small" icon="el-icon-edit" @click="handle(scope.row)">选择</el-button>
        </template>
      </vxe-table-column>
    </vxe-table>
  </el-dialog>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
export default {
  mixins: [mixinViewModule],
  data () {
    return {
      visible: false,
      mixinViewModuleOptions: {
        getDataListURL: '/msg/msgBizRule/list',
        getDataListIsPage: false
      },
      dataForm: {
        title: '',
        eventCode: ''
      }
    }
  },
  components: {
  },
  methods: {
    handle (row) {
      this.$emit('select', row, row.pushType)
      this.visible = false
    }
  }
}
</script>
